#include <iostream>
using namespace std;

class Base
{
    public:
        void f(int x)  { cout << "Base::f(int) " << x << endl; }
        void f(float x) { cout << "Base::f(float) " << x << endl; }
        virtual void g(void)    { cout << "Base::g(void)" << endl;}             
        void h(float x) { cout << "Base::h(float) " << x << endl;}
        void k(float x) { cout << "Base::k(float) " << x << endl;}
};
class Derived : public Base
{
    public:
        virtual void g(void)    { cout << "Derived::g(void)" << endl;}
        void h(int x)  { cout << "Derived::h(int) " << x << endl; }
        void k(float x) { cout << "Derived::k(float) " << x << endl;}

};

int main(void)
{
    Derived d;
    Base*pb = &d;
    Derived *pd = &d;

    pb->f(42);    // Base::f(int) 42          //重载
    pb->f(3.14f); // Base::f(float) 3.14      //重载

    pb->g();      // Derived::g(void)          //覆盖
    pd->g();      // Derived::g(void)          //覆盖

    pb->h(3.14f);  // Base::h(float) 3.14      //隐藏
    pd->h(3.14f);  // Derived::h(int) 3        //隐藏

    pb->k(3.14f); // Base::k(float) 3.14      //隐藏
    pd->k(3.14f); // Derived::k(float) 3.14    //隐藏 

    return 0;
} 
